<?php

namespace app\teacher\model;

use app\common\model\BaseModel;
use think\Model;

class TeacherBusy extends BaseModel
{
    protected $autoWriteTimestamp = 'int';
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';

    /**
     * 新增忙碌时间
     */
    public function add(array $data)
    {
        return $this->allowField(true)->save($data);
    }

    /**
     * 教师时间
     */
    public static function getTeacherTime($teacherId)
    {
        return self::where('teacher_id', $teacherId)->find();
    }
}
